import { DbModule } from '@libs/db';
import { Module } from '@nestjs/common';
import { AdminController } from './admin.controller';
import { AdminService } from './admin.service';
import { UsersController } from './users/users.controller';
import { UsersModule } from './users/users.module';
import { SlidesController } from './slides/slides.controller';
import { SlidesModule } from './slides/slides.module';
import { ArticlesController } from './articles/articles.controller';
import { ArticlesModule } from './articles/articles.module';
import { MulterModule } from '@nestjs/platform-express';
import { EquipsController } from './equips/equips.controller';
import { EquipsModule } from './equips/equips.module';
import { HerosController } from './heros/heros.controller';
import { HerosModule } from './heros/heros.module';

@Module({
  imports: [
    MulterModule.register({   // 静态资源，写好后，会自动创建一个文件夹
      dest: 'uploads'
    }),
    DbModule,  // 引进 db 连接数据库模块，在这里进行挂载
    UsersModule, SlidesModule, ArticlesModule, EquipsModule, HerosModule
  ],
  controllers: [AdminController, UsersController, SlidesController, ArticlesController, EquipsController, HerosController],
  providers: [AdminService],
})
export class AdminModule {}
